exports.send = (socket, data, core) => {
  let logger = core.getLogger('0x6c');
  let publisher = core.getService('redis').getClient();
  const userIdBuf = core.createIntBuffer(1, 2);
  const cmdIndexBuf = core.createIntBuffer(2, 2);
  let cardNumber = Buffer.alloc(16),
      processNumber = Buffer.alloc(8),
      customerNumber = Buffer.alloc(30),

      accountBalance = Buffer.alloc(12),
      accountAvailableBalance = Buffer.alloc(12),

      serviceBalance = Buffer.alloc(12),
      serviceAvailableBalance = Buffer.alloc(12),

      centerTransactionId = Buffer.alloc(15),
      bossTransactionId = Buffer.alloc(20),
      transactionDate = core.date.date2Buffer(new Date()),

      chargingPort,
      // 默认自然充满模式
      chargingMode = core.createIntBuffer(0x20, 1),
      planChargingTime = core.createIntBuffer(0, 4),
      planChargingDegree = core.createIntBuffer(0, 4),

      authenticationCode = core.createIntBuffer(0, 8);
      // TODO   Buffer的长度有问题
      // processNumber = new Buffer.from('00000000', 'hex');
      // processNumber = new Buffer.from('0A010000', 'hex');
      // processNumber = new Buffer.from('0B010000', 'hex');
      // processNumber = new Buffer.from('FFFFFFFF', 'hex');
      // customerNumber.write('LSJE12835CS110420，京 B1234，C1B1')
      cardNumber.write(data.mobileNo, 5);
      accountBalance.write(data.balance);
      accountAvailableBalance.write(data.balance);
      serviceBalance.write(data.balance);
      serviceAvailableBalance.write(data.balance);
      centerTransactionId.write(data.numbers);
      chargingPort = core.createIntBuffer(parseInt(data.port), 1);
      // 判断其他模式
      if (data.mode == '0x20') {

      }
      logger.info(data);
      socket.once(`0x71-${userIdBuf.toString('hex')}-${cmdIndexBuf.toString('hex')}`, (info) => {
        publisher.publish('commandback', JSON.stringify({
          result: { data: info },
          callback: data.callback,
        }));
      });
      publisher.setex(`centerTransactionId:${data.charging}-${data.mobileNo}`, [120, data.numbers], () => {
        socket.sendCommands(0x6c, core.concat([
          userIdBuf,
          cmdIndexBuf,
          cardNumber,
          processNumber,
          customerNumber,
          accountBalance,
          accountAvailableBalance,
          serviceBalance,
          serviceAvailableBalance,
          centerTransactionId,
          bossTransactionId,
          transactionDate,
          chargingPort,
          chargingMode,
          planChargingTime,
          planChargingDegree,
          authenticationCode,
        ]));
      });
}
